package com.springsource.mvc.HandlerMappingAndHandlerAdapter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

@Controller
@Slf4j
public class Controller1 {

    @GetMapping("/test1")
    public ModelAndView test1() throws Exception {
        log.warn("test1()");
        return null;
    }

    @PostMapping("/test2")
    public ModelAndView test2(@RequestParam("name") String name) {
        log.warn("test2({})", name);
        return null;
    }

    @PutMapping("/test3")
    public ModelAndView test3(@Token String token) {
        log.warn("test3({})", token);
        return null;
    }

    @RequestMapping("/test4.yml")
    @Yml
    public User test4() {
        log.warn("test4()");
        return new User("张三", 18);
    }



}
